Skip to content

Fix Android Build and Release Workflow#3

Open
involvex wants to merge 1 commit intomainfrom
fix-android-workflow-14536346782417575066
Open

Fix Android Build and Release Workflow#3
involvex wants to merge 1 commit intomainfrom
fix-android-workflow-14536346782417575066

Conversation

@involvex
Copy link
Owner

@involvex involvex commented Feb 28, 2026

Fixed the Android build and release workflow by addressing pathing issues, consolidating jobs for better performance, and updating outdated action versions. The workflow now correctly runs expo prebuild, builds the APK within the android/ directory, and uploads the resulting artifact to a GitHub Release.


PR created automatically by Jules for task 14536346782417575066 started by @involvex

Summary by Sourcery

Update Android GitHub Actions workflow to build and release APKs from a single job and align app metadata with the new release.

Enhancements:

  • Increase the Android app versionCode and versionName for the new release and update theme styles to use transparent system bars.

Build:

  • Consolidate Android build and release into a single GitHub Actions job, fixing working directories, artifact paths, and adding required GitHub token configuration.
  • Update GitHub Actions to use current versions of checkout and setup-java, and adjust the Expo prebuild invocation for Android builds.

Deployment:

  • Configure the Android GitHub Actions workflow to upload the built APK from the correct android/app path to GitHub Releases when a tag is pushed.

- Consolidate build and release jobs into a single workflow job
- Update action versions (checkout@v4, setup-java@v4)
- Fix working directory for Gradle commands (set to android/)
- Correct path to release APK (android/app/build/outputs/apk/release/app-release.apk)
- Use standard Expo prebuild command
- Add GITHUB_TOKEN for release creation and asset upload

Co-authored-by: involvex <39644169+involvex@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2026

⚠️ No Changeset found

Latest commit: 4e513d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 28, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Consolidates the Android CI workflow into a single build-and-release job that correctly prebuilds and builds the APK from the android/ directory, updates action versions and paths, wires up GitHub Releases with authentication, and bumps the Android app version and visual system bar styling.

Sequence diagram for consolidated Android build-and-release job

sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub
  participant WF as ActionsWorkflow android.yml
  participant JR as Job build-and-release
  participant R as Runner ubuntu-latest
  participant Expo as ExpoCLI
  participant Gradle as GradleBuild
  participant Rel as GitHubReleaseService

  Dev->>GH: Push tag or dispatch workflow
  GH-->>WF: Trigger workflow android.yml
  WF-->>JR: Start job build-and-release
  JR-->>R: Provision runner ubuntu-latest

  R->>R: actions/checkout v4
  R->>R: oven-sh/setup-bun v1
  R->>R: bun install

  R->>Expo: npx expo prebuild --platform android --no-install
  Expo-->>R: Generate android project

  R->>R: actions/setup-java v4 (Java 17 temurin)
  R->>Gradle: chmod +x ./gradlew (working-directory android)
  R->>Gradle: ./gradlew assembleRelease (working-directory android)
  Gradle-->>R: Build APK at android/app/build/outputs/apk/release/app-release.apk

  alt ref_type is tag
    R->>Rel: softprops/action-gh-release v2 with APK path and GITHUB_TOKEN
    Rel-->>Dev: Published release with attached APK
  else ref_type is not tag
    R-->>WF: Skip release step
  end
Loading

File-Level Changes

Change Details Files
Unifies Android CI into a single build-and-release workflow and fixes build pathing.
  • Renamed the main job from Gradle to build-and-release and removed the separate Release job, so build and release run in a single job.
  • Updated checkout and Java setup actions to current major versions to avoid deprecation issues.
  • Adjusted the expo prebuild step to use npx expo prebuild with explicit Android platform and no-install to ensure correct native project generation without re-installing dependencies.
  • Set working-directory to android for Gradle-related steps so ./gradlew and assembleRelease run from the proper folder.
.github/workflows/android.yml
Fixes artifact pathing and authentication for GitHub Release publishing.
  • Changed the release artifact path to android/app/build/outputs/apk/release/app-release.apk to match the Android subdirectory layout.
  • Added GITHUB_TOKEN environment variable from secrets to authenticate softprops/action-gh-release.
  • Retained tag-based conditional so releases only occur on tag refs while now using the unified job.
.github/workflows/android.yml
Bumps Android app version for the new release.
  • Incremented versionCode from 5 to 6.
  • Incremented versionName from 0.0.5 to 0.0.6.
android/app/build.gradle
Tweaks Android theme to use transparent system bars.
  • Set android:statusBarColor to @android:color/transparent.
  • Set android:navigationBarColor to @android:color/transparent to visually match the app design.
android/app/src/main/res/values/styles.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Android build and release process by rectifying previous workflow inefficiencies and outdated configurations. The changes streamline the build pipeline, ensuring reliable APK generation and proper artifact management for releases.

Highlights

  • Android Build Fixes: Resolved issues in the Android build and release workflow, ensuring correct execution of expo prebuild and APK generation within the android/ directory.
  • Workflow Optimization: Consolidated GitHub Actions jobs for improved performance and updated outdated action versions.
  • Release Artifact Handling: Ensured the built APK is correctly uploaded to a GitHub Release.
Changelog
  • android/app/build.gradle
    • Updated versionCode from 5 to 6.
    • Updated versionName from "0.0.5" to "0.0.6".
  • android/app/src/main/res/values/styles.xml
    • Added android:statusBarColor and android:navigationBarColor to be transparent.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/android.yml
Activity
  • PR was automatically created by Jules for a task started by @involvex.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Switching from bun run expo:prebuild to npx expo prebuild --platform android --no-install bypasses any custom options in the existing expo:prebuild script; consider reusing the script or mirroring its flags to avoid divergence between local and CI builds.
  • If you want to speed up this consolidated workflow further, consider adding caching for Bun dependencies and Gradle (e.g., using actions/cache) so repeated runs don’t reinstall everything from scratch.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Switching from `bun run expo:prebuild` to `npx expo prebuild --platform android --no-install` bypasses any custom options in the existing `expo:prebuild` script; consider reusing the script or mirroring its flags to avoid divergence between local and CI builds.
- If you want to speed up this consolidated workflow further, consider adding caching for Bun dependencies and Gradle (e.g., using `actions/cache`) so repeated runs don’t reinstall everything from scratch.

## Individual Comments

### Comment 1
<location path=".github/workflows/android.yml" line_range="35-40" />
<code_context>
-    runs-on: ubuntu-latest
-    steps:
+        working-directory: android
       - name: Release to GitHub
         uses: softprops/action-gh-release@v2
         if: github.ref_type == 'tag'
         with:
-          files: app/build/outputs/apk/release/app-release.apk
+          files: android/app/build/outputs/apk/release/app-release.apk
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
</code_context>
<issue_to_address>
**🚨 issue (security):** Explicitly set `permissions` for `GITHUB_TOKEN` to ensure the release step can write releases

`softprops/action-gh-release` requires `GITHUB_TOKEN` with `contents: write` to create or update releases. With newer GitHub defaults, `contents` may be read-only unless explicitly set. Please add a `permissions:` block (at workflow or job level) granting `contents: write` so this step continues to work reliably if defaults change.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines 35 to +40
- name: Release to GitHub
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: app/build/outputs/apk/release/app-release.apk
files: android/app/build/outputs/apk/release/app-release.apk
env:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Explicitly set permissions for GITHUB_TOKEN to ensure the release step can write releases

softprops/action-gh-release requires GITHUB_TOKEN with contents: write to create or update releases. With newer GitHub defaults, contents may be read-only unless explicitly set. Please add a permissions: block (at workflow or job level) granting contents: write so this step continues to work reliably if defaults change.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Android version and theme styles. However, the changes are applied directly to files within the android/ directory. According to the repository's GEMINI.md engineering standards (line 65), the android/ directory is generated by expo prebuild and should not be committed to version control. This practice, known as Continuous Native Generation (CNG), is a core convention for this project. To adhere to this, version changes should be made in app.json, and style changes should also be configured through app.json or other Expo APIs, not by editing native files directly. The android/ directory should be added to .gitignore to prevent these generated files from being tracked.

Comment on lines +95 to +96
versionCode 6
versionName "0.0.6"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

These version changes are applied to a generated file. According to the project's GEMINI.md guide (line 65), the android/ directory is managed by expo prebuild and should not be committed. The version and android.versionCode should be updated in app.json, and the android/ directory should be added to .gitignore.

References
  1. The android/ and ios/ folders are generated via expo prebuild and should NOT be committed. This is part of the Continuous Native Generation (CNG) workflow. (link)

Comment on lines +6 to +7
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

These style changes are made directly in a native file that is part of the auto-generated android/ directory. Per the GEMINI.md guide (line 65), this directory should not be committed. To achieve transparent status and navigation bars, please configure this in app.json using the androidStatusBar and androidNavigationBar properties. This ensures your configuration is the source of truth and is not overwritten by expo prebuild.

References
  1. The android/ and ios/ folders are generated via expo prebuild and should NOT be committed. This is part of the Continuous Native Generation (CNG) workflow. (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant